// store/error-log.ts
import { defineStore } from 'pinia'

interface ErrorLog {
  err: Error;
  instance: any;
  info: string;
  url: string;
}

export const useErrorLogStore = defineStore('errorLog', {
  state: () => ({
    logs: [] as ErrorLog[]
  }),
  actions: {
    addErrorLog(log: ErrorLog) {
      this.logs.push(log)
    },
    clearErrorLog() {
      this.logs.splice(0)
    }
  }
})